
<?php

use peng\core\Form;
use peng\helpers\Html;
use common\dao\dd\DataDao;

$rtypeList = DataDao::getSingleton()->getRegisteredUserType();
?>
<div id="mainbody" class="CWL CWR">
    <div id="loginDiv">
        <div id="logininfo">
            <div class="loginad">
                <div id="bannerlogin">
                    <div id="banner_bg"></div><!--标题背景-->
                    <div id="banner_info"></div><!--标题-->
                    <ul>
                        <li class="on">1</li>
                        <li>2</li>
                        <li>3</li>
                        <li>4</li>
                    </ul>
                    <div id="banner_list">
                        <a href="#" target="_blank"><img src="<?php echo $this->cssPath; ?>web/images/1.jpg" title="广告1" alt="广告1"/></a>
                        <a href="#" target="_blank"><img src="<?php echo $this->cssPath; ?>web/images/w0.png" title="广告2" alt="广告2"/></a>
                        <a href="#" target="_blank"><img src="<?php echo $this->cssPath; ?>web/images/w1.jpg" title="广告3" alt="广告3"/></a>
                        <a href="#" target="_blank"><img src="<?php echo $this->cssPath; ?>web/images/w6.png" title="广告4" alt="广告4"/></a>
                    </div>
                </div>

                <script type="text/javascript">
                    var t = n = 0, count;
                    $(document).ready(function() {
                        count = $("#banner_list a").length;
                        $("#banner_list a:not(:first-child)").hide();
                        $("#banner_info").html($("#banner_list a:first-child").find("img").attr('alt'));
                        $("#banner_info").click(function() {
                            window.open($("#banner_list a:first-child").attr('href'), "_blank")
                        });
                        $("#bannerlogin li").click(function() {
                            var i = $(this).text() - 1;//获取Li元素内的值，即1，2，3，4
                            n = i;
                            if (i >= count)
                                return;
                            $("#banner_info").html($("#banner_list a").eq(i).find("img").attr('alt'));
                            $("#banner_info").unbind().click(function() {
                                window.open($("#banner_list a").eq(i).attr('href'), "_blank")
                            })
                            $("#banner_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
                            document.getElementById("bannerlogin").style.background = "";
                            $(this).toggleClass("on");
                            $(this).siblings().removeAttr("class");
                        });
                        t = setInterval("showAuto()", 4000);
                        $("#bannerlogin").hover(function() {
                            clearInterval(t)
                        }, function() {
                            t = setInterval("showAuto()", 4000);
                        });
                    })

                    function showAuto()
                    {
                        n = n >= (count - 1) ? 0 : ++n;
                        $("#bannerlogin li").eq(n).trigger('click');
                    }
                </script>			
            </div>

            <div id="loginCar">	
                <?php $form = Form::begin() ?>
                <div class="main-inner" >
                </div>
                <div class="login" >
                    <div class="login-tab">
                        <div id="lbGoods" class="login-tab-goods">货主登录</div>
                        <div id="lbCar" class="login-tab-car ">车主登录</div>
                    </div>
                    <div class="login-null">
                    </div>
                    <div class="login-form-radio">
                        <?php echo $form->activeRadio($this->model, 'utype', $rtypeList,array('class'=>'radi')); ?>
                    </div>   
                    <div id="inputID" class="login-form-item show-placeholder">
                        <b class="ico ico-uid"></b>
                        <?php echo $form->activeText($this->model, 'loginname', array('class' => 'form-item', 'maxlength' => 50, 'autocomplete' => 'off')) ?>
                    </div>
                    <div id="inputPwd" class="login-form-item show-placeholder">
                        <b class="ico ico-pwd"></b>
                        <?php echo $form->activePassword($this->model, 'upassword', array('class' => 'form-item', 'maxlength' => 50, 'autocomplete' => 'off')) ?>
                    </div>			
                    <div class="login-form-check">
                        <div id="lfAutoLogin" class="inner">
                            <?php echo $form->activeCheckbox($this->model, 'rememberMe', array('是否记住我' => 1), array('class' => 'ogin-form-cbx')) ?>
                        </div>
                        <div class="input-forget-pwd">						

                        </div>
                    </div>
                    <div class="login-form-btn">
                        <?php echo Html::submitButton('登&nbsp;&nbsp;录', array('class' => 'btn btn-login', 'name' => 'submit-button')) ?> 
                        <a class="btn btn-reg" href="/user/signup" target="_blank" tabindex="5">注&nbsp;&nbsp;册</a>
                    </div>
                    <div class="ext">
                        <div>
                            <?php echo $this->model->getErrorSummary(); ?>
                        </div>
                        <div>
                            为了您的信息安全，请不要在网吧或公用电脑上使用此功能！		
                        </div>	
                    </div>
                </div>
                <?php Form::end(); ?>
                <script type="text/javascript" >
                    $(function() {
                        $("#lbGoods").bind("mouseover",
                                function() {
                                    $(".login").removeClass("tab-2");
                                });
                        $("#lbCar").bind("mouseover",
                                function() {
                                    $(".login").addClass("tab-2");
                                });
                        $("#password").bind({
                            focus: function() {
                                $("#inputPwd").addClass("loginFormIpt-focus");
                            },
                            blur: function() {
                                $("#inputPwd").removeClass("loginFormIpt-focus");
                            }
                        }).bind("propertychange input load",
                                function() {
                                    if ($(this).val().length > 0) {
                                        $("#inputPwd").removeClass("show-placeholder");
                                    } else {
                                        $("#inputPwd").addClass("show-placeholder");
                                    }
                                });
                        $("#loginName").bind({
                            focus: function() {
                                $("#inputID").addClass("loginFormIpt-focus");
                            },
                            blur: function() {
                                $("#inputID").removeClass("loginFormIpt-focus");
                            }
                        }).bind("propertychange input load",
                                function() {
                                    if ($(this).val().length > 0) {
                                        $("#inputID").removeClass("show-placeholder");
                                    } else {
                                        $("#inputID").addClass("show-placeholder");
                                    }
                                });
                    })
                </script>
            </div>
        </div>
        <span class="clr"></span>
    </div>	
</div>